package cn.liangcaomei.educms.controller;


import cn.liangcaomei.commonutils.R;
import cn.liangcaomei.educms.entity.CrmBanner;
import cn.liangcaomei.educms.service.CrmBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前台banner展示控制器
 * </p>
 *
 * @author LiuJie
 * @since 2024-02-04
 */
@RestController
@RequestMapping("/educms/bannerfront")
@CrossOrigin
public class BannerFrontController {

    //注入service
    @Autowired
    private CrmBannerService crmBannerService;

    //1 查询所有的Banner
    @GetMapping("getAllBanner")
    public R byIdBanner(){
        List<CrmBanner> bannerList = crmBannerService.seleteAllBanner();
        return R.ok().data("list",bannerList);
    }




}

